package com.xunfang.portal.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xunfang.common.RedisConst;
import com.xunfang.portal.model.entity.BookType;
import com.xunfang.portal.service.BookTypeService;
import com.xunfang.portal.mapper.BookTypeMapper;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author scott
* @description 针对表【t_book_type】的数据库操作Service实现
* @createDate 2025-10-10 09:20:56
*/
@Service
public class BookTypeServiceImpl extends ServiceImpl<BookTypeMapper, BookType>
    implements BookTypeService{

    //这里进行缓存
    @Override
    //使用自定义的缓存生成策略
    @Cacheable(cacheNames = RedisConst.BOOK_TYPE_LIST, keyGenerator = "keyGenerator")
    public List<BookType> findAll() {
        return list();
    }
}




